package com.sany.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.sany.util.log.ILogger;
import com.sany.web.database.SapDatabase;

public class SapUtil {
	private static final ILogger log = ILogger.getInstance().getILogger(SapUtil.class);
	private static ApplicationContext ctx;
	static final String CONFIG_FILE_LOCATION = "com/sany/spring/applicationContext.xml";
	
	public static SapDatabase getSapDatabase() {
		SapDatabase sapDatabase;
		if (ctx == null) {
			ctx = new ClassPathXmlApplicationContext(CONFIG_FILE_LOCATION);
		}
		sapDatabase = (SapDatabase) ctx.getBean("sapDatabase");
		return sapDatabase;
	}



//
}
